import req from "@/utils/request";
const baseURL = process.env.VUE_APP_BASE_URL;

export function downLoadTaskInfo(data) {
  return req({
    method: "post",
    url: baseURL + `/superlink/api/AdhmiService/taskInfo`,
    data
  });
}
export function getDevicesV2Tree(params) {
  return req({
    method: "get",
    url: baseURL + `/superlink/api/devices/v2/tree`,
    params
  });
}
export function getMeasurements(deviceToken, params) {
  return req({
    method: "get",
    url: baseURL + `/superlink/api/devices/${deviceToken}/measurements`,
    params
  });
}
export function getTaskFeedback(params) {
  return req({
    method: "get",
    url: baseURL + `/superlink/api/taskUpload/list`,
    params
  });
}
export function getTaskDownLoadInfos(params) {
  return req({
    method: "get",
    url: baseURL + `/superlink/api/taskDownload/list`,
    params
  });
}

export function formulaRecordInfos(params) {
  return req({
    method: "get",
    url: baseURL + `/superlink/api/formulaRecord/list`,
    params
  });
}

export function formulaRecordDetails(id) {
  return req({
    method: "get",
    url: baseURL + `/superlink/api/formulaDownload/byToken/${id}`
  });
}

export function updateFormulaDownloadInfo(token, data) {
  return req({
    method: "put",
    url: baseURL + `/superlink/api/formulaDownload/update`,
    data
  });
}

export function formulaEdit(data) {
  return req({
    method: "post",
    url: baseURL + `/superlink/api/taskDownload/taskFormulaDown`,
    data
  });
}
export function updateFormulaDownloadInfoZK(data) {
  return req({
    method: "put",
    url: baseURL + `/superlink/api/formulaDownload/updateZK`,
    data
  });
}

// 远程控制
export function controlModeDown(data) {
  return req({
    method: "post",
    url: baseURL + `/superlink/api/taskDownload/controlModeDown`,
    data
  });
}
